﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using NyMPH.Persistence;
using NyMPH.Patches;
using System.Data.SqlServerCe;



namespace NyMPHTestWrappers
{
    public partial class Form1 : Form
    {


        private NyMPHTestWrappers.Properties.Settings MySettings = new NyMPHTestWrappers.Properties.Settings();

        public Form1()
        {
            InitializeComponent();
        }

        private void btnOpenData_Click(object sender, EventArgs e)
        {
            new NyMPHDataTestWrapper().ShowDialog();
        }

        private void btnTestKeywords_Click(object sender, EventArgs e)
        {
            SqlCeConnection _conn = new SqlCeConnection(string.Format(@"Data Source={0};Persist Security Info=False;", MySettings.LastDBPath));
            KeywordDataHelper kdh = new KeywordDataHelper(_conn);

            //works
            //kdh.GetKeywordsByType(SDKCategories.Articulation);

            //works
            //Keyword k = new Keyword();
            //k.Name = "TestInsert";
            //k.KeywordType = SDKCategories.InstrumentType;
            //k.IsCustom = true;


            //kdh.SaveKeyword(ref k);




            Application.DoEvents();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            NyMPH.Dialogs.frmKeywordEdit _form = new NyMPH.Dialogs.frmKeywordEdit();

            _form.ShowDialog();

        }

        private void button2_Click(object sender, EventArgs e)
        {
            SqlCeConnection _conn = new SqlCeConnection(string.Format(@"Data Source={0};Persist Security Info=False;", MySettings.LastDBPath));

            Database d = new Database();

            Console.WriteLine(d.KeywordDAL.GetKeywordsByType(SDKCategories.Articulation).Count);
            
            
        }
    }
}
